import {baseURL} from './config.js';

export default function request(options){
    return new Promise((resolve, reject) => {
        wx.request({
            url: baseURL + options.url,
            data: options.data || {},
            method: options.method ||'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
            header: options.header || {}, // 设置请求的 header
            success: resolve,
            fail: reject
        })
    })
}
